package cn.lg.soar.message.entity;

import cn.lg.soar.database.base.entity.BaseEntity;
import cn.lg.soar.database.base.entity.ITenantEntity;
import cn.lg.soar.message.api.enums.NoticeRecipientTypeEnum;
import cn.lg.soar.message.api.enums.NoticeTypeEnum;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author luguoxiang
 * @date 2022/4/5
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@ApiModel(value = "通知", description = "通知")
@Getter
@Setter
@TableName("lg_msg_notice")
public class Notice extends BaseEntity implements ITenantEntity, Serializable {

    @ApiModelProperty(value = "主键id")
    @TableId
    private Long id;
    /**
     * 内容
     */
    @ApiModelProperty(value = "内容")
    private String content;

    /**
     * 时间
     */
    @ApiModelProperty(value = "时间")
    private LocalDateTime datetime;

    /**
     * 业务类型（用于判断跳转的地址）
     */
    @ApiModelProperty(value = "业务类型（用于判断跳转的地址）")
    private String bizType;

    /**
     * 业务参数（永远携带业务信息，如：id）
     */
    @ApiModelProperty(value = "业务参数（永远携带业务信息，如：id）")
    private String bizParams;

    /**
     * 类型
     */
    @ApiModelProperty(value = "类型")
    private NoticeTypeEnum type;

    /**
     * 接收人类型
     */
    @ApiModelProperty(value = "接收人类型")
    private NoticeRecipientTypeEnum recipientType;

    @ApiModelProperty(value = "租户id")
    @JsonIgnore
    @TableField(select = false)
    private Integer tenantId;

    @Override
    public Serializable primaryKey() {
        return id;
    }
}
